/*
 * $Id: mempool_test.c 3 2007-07-10 06:59:05Z kf701.ye $
 */

#include "factory.h"

struct my_protocol_header{
	uint32_t length;
	uint8_t type;
	uint8_t padding[3];
};

int main()
{
	debug_verbose = 4;

	mem_pool_t *mem_pool;
	mem_pool = mem_pool_create(sizeof(struct my_protocol_header), 10);

	char *ptr[10];
	int i;
	for( i=0; i<10; i++ )
	{
		ptr[i] = mem_pool_malloc( mem_pool );
	}
	mem_pool_debug(mem_pool);
	getchar();
	
	for( i=0; i<10; i++ )
	{
		mem_pool_free( mem_pool, ptr[i] );
	}
	mem_pool_debug(mem_pool);
	getchar();

	mem_pool_destory(mem_pool);
	getchar();

	return 0;
}
